﻿using MediatR;
using T.Basic.API.Appliction.Command.LineCommand;
using T.Basic.Repository.BasicInterface;

namespace T.Basic.API.Appliction.CommandHandlers.LineHanders
{
    /// <summary>
    /// 修改线路
    /// </summary>
    public class LineUpdateCommandHandler : IRequestHandler<LineUpdateCommand, int>
    {
        private readonly ILineRepository _lineRepository;
        public LineUpdateCommandHandler(ILineRepository lineRepository)
        {
            _lineRepository = lineRepository;
        }

        public async Task<int> Handle(LineUpdateCommand request, CancellationToken cancellationToken)
        {
            return await _lineRepository.UpdateAsync(request);
        }
    }
}
